<?xml version="1.0" encoding="ascii"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
          "DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>pygccxml.parser.source_reader.source_reader_t</title>
  <link rel="stylesheet" href="epydoc.css" type="text/css" />
  <script type="text/javascript" src="epydoc.js"></script>
</head>

<body bgcolor="white" text="black" link="blue" vlink="#204080"
      alink="#204080">
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">
  <!-- Home link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="pygccxml-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Project homepage -->
      <th class="navbar" align="right" width="100%">
        <table border="0" cellpadding="0" cellspacing="0">
          <tr><th class="navbar" align="center"
            ><a class="navbar" target="_top" href="http://www.language-binding.net">pygccxml</a></th>
          </tr></table></th>
  </tr>
</table>
<table width="100%" cellpadding="0" cellspacing="0">
  <tr valign="top">
    <td width="100%">
      <span class="breadcrumbs">
        <a href="pygccxml-module.html">Package&nbsp;pygccxml</a> ::
        <a href="pygccxml.parser-module.html">Package&nbsp;parser</a> ::
        <a href="pygccxml.parser.source_reader-module.html">Module&nbsp;source_reader</a> ::
        Class&nbsp;source_reader_t
      </span>
    </td>
    <td>
      <table cellpadding="0" cellspacing="0">
        <!-- hide/show private -->
        <tr><td align="right"><span class="options"
            >[<a href="frames.html" target="_top">frames</a
            >]&nbsp;|&nbsp;<a href="pygccxml.parser.source_reader.source_reader_t-class.html"
            target="_top">no&nbsp;frames</a>]</span></td></tr>
      </table>
    </td>
  </tr>
</table>
<!-- ==================== CLASS DESCRIPTION ==================== -->
<h1 class="epydoc">Class source_reader_t</h1><br /><br />
<pre class="literalblock">

This class reads C++ source code and returns declarations tree.

This class is the only class that have an intime knowledge about GCC-XML. 
It has only one responsibility: it calls GCC-XML with a source file specified
by user and creates declarations tree. The implementation of this class is split
to 2 classes: 

1. L{scanner_t} - this class scans the &quot;XML&quot; file, generated by GCC-XML and 
   creates `pygccxml`_ declarations and types classes. After the xml file has 
   been processed declarations and type class instances keeps references to 
   each other using GCC-XML generated id's. 

2. L{linker_t} - this class contains logic for replacing GCC-XML generated 
   ids with references to declarations or type class instances.

</pre><br /><br />

<!-- ==================== INSTANCE METHODS ==================== -->
<a name="section-InstanceMethods"></a>
<table class="summary" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td colspan="2" class="table-header">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
      <tr valign="top">
        <td align="left"><span class="table-header">Instance Methods</span></td>
        <td align="right" valign="top"
         ><span class="options">[<a href="#section-InstanceMethods"
         class="privatelink" onclick="toggle_private();"
         >hide private</a>]</span></td>
      </tr>
    </table>
  </td>
</tr>
<tr>
  <td width="15%" align="right" valign="top" class="summary">
    <span class="summary-type">&nbsp;</span>
  </td><td class="summary">
    <span class="summary-sig"><a href="pygccxml.parser.source_reader.source_reader_t-class.html#__init__" class="summary-sig-name">__init__</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">config</span>,
        <span class="summary-sig-arg">cache</span>=<span class="summary-sig-default">None</span>,
        <span class="summary-sig-arg">decl_factory</span>=<span class="summary-sig-default">None</span>)</span>
  </td>
</tr>
<tr>
  <td width="15%" align="right" valign="top" class="summary">
    <span class="summary-type">&nbsp;</span>
  </td><td class="summary">
    <span class="summary-sig"><a href="pygccxml.parser.source_reader.source_reader_t-class.html#create_xml_file" class="summary-sig-name">create_xml_file</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">header</span>,
        <span class="summary-sig-arg">destination</span>=<span class="summary-sig-default">None</span>)</span><br />
      This function will return the file name of the file, created by 
      GCC-XML for &quot;header&quot; file.
  </td>
</tr>
<tr>
  <td width="15%" align="right" valign="top" class="summary">
    <span class="summary-type">&nbsp;</span>
  </td><td class="summary">
    <span class="summary-sig"><a href="pygccxml.parser.source_reader.source_reader_t-class.html#create_xml_file_from_string" class="summary-sig-name">create_xml_file_from_string</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">content</span>,
        <span class="summary-sig-arg">destination</span>=<span class="summary-sig-default">None</span>)</span><br />
      Creates XML file from text.
  </td>
</tr>
<tr>
  <td width="15%" align="right" valign="top" class="summary">
    <span class="summary-type">&nbsp;</span>
  </td><td class="summary">
    <span class="summary-sig"><a href="pygccxml.parser.source_reader.source_reader_t-class.html#read_file" class="summary-sig-name">read_file</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">source_file</span>)</span><br />
      Reads C++ source file and returns declarations tree
  </td>
</tr>
<tr>
  <td width="15%" align="right" valign="top" class="summary">
    <span class="summary-type">&nbsp;</span>
  </td><td class="summary">
    <span class="summary-sig"><a href="pygccxml.parser.source_reader.source_reader_t-class.html#read_xml_file" class="summary-sig-name">read_xml_file</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">gccxml_created_file</span>)</span><br />
      Reads GCC-XML generated XML file.
  </td>
</tr>
<tr>
  <td width="15%" align="right" valign="top" class="summary">
    <span class="summary-type">&nbsp;</span>
  </td><td class="summary">
    <span class="summary-sig"><a href="pygccxml.parser.source_reader.source_reader_t-class.html#read_string" class="summary-sig-name">read_string</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">content</span>)</span><br />
      Reads Python string, that contains valid C++ code, and returns 
      declarations tree.
  </td>
</tr>
</table>

<br />
<!-- ==================== METHOD DETAILS ==================== -->
<a name="section-MethodDetails"></a>
<table class="summary" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td colspan="2" class="table-header">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
      <tr valign="top">
        <td align="left"><span class="table-header">Method Details</span></td>
        <td align="right" valign="top"
         ><span class="options">[<a href="#section-MethodDetails"
         class="privatelink" onclick="toggle_private();"
         >hide private</a>]</span></td>
      </tr>
    </table>
  </td>
</tr>
</table>
<a name="__init__"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">__init__</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">config</span>,
        <span class="sig-arg">cache</span>=<span class="sig-default">None</span>,
        <span class="sig-arg">decl_factory</span>=<span class="sig-default">None</span>)</span>
    <br /><em class="fname">(Constructor)</em>
  </h3>
  </td><td align="right" valign="top"
    >&nbsp;
    </td>
  </table>
  
  
  <dl><dt></dt><dd>
    <dl><dt>Parameters:</dt></dl>
    <ul class="nomargin">
        <li><strong class="pname"><code>config</code></strong> (<a href="pygccxml.parser.config.config_t-class.html" 
          class="link">config_t</a>) - instance of <a 
          href="pygccxml.parser.config.config_t-class.html" 
          class="link">config_t</a> class, that contains GCC-XML 
          configuration</li>
        <li><strong class="pname"><code>cache</code></strong> - reference to cache object, that will be updated after file has
          been parsed.</li>
        <li><strong class="pname"><code>cache</code></strong> - {cache_base_t}</li>
        <li><strong class="pname"><code>decl_factory</code></strong> - declarations factory, if not given default declarations 
          factory <a 
          href="pygccxml.declarations.decl_factory.decl_factory_t-class.html"
          class="link">decl_factory_t</a> will be used</li>
    </ul>
  </dd></dl>
</td></tr></table>
</div>
<a name="create_xml_file"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">create_xml_file</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">header</span>,
        <span class="sig-arg">destination</span>=<span class="sig-default">None</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    >&nbsp;
    </td>
  </table>
  
  <br />This function will return the file name of the file, created by 
  GCC-XML for &quot;header&quot; file. If destination_file_path is not 
  None, then this file path will be used and returned.
  <dl><dt></dt><dd>
    <dl><dt>Parameters:</dt></dl>
    <ul class="nomargin">
        <li><strong class="pname"><code>header</code></strong> (str) - path to source file, that should be parsed</li>
        <li><strong class="pname"><code>destination</code></strong> (str) - if given, will be used as target file/path for GCC-XML 
          generated file.</li>
    </ul>
    <dl><dt>Returns:</dt>
        <dd>path to GCC-XML generated file</dd></dl>
  </dd></dl>
</td></tr></table>
</div>
<a name="create_xml_file_from_string"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">create_xml_file_from_string</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">content</span>,
        <span class="sig-arg">destination</span>=<span class="sig-default">None</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    >&nbsp;
    </td>
  </table>
  
  <br />Creates XML file from text.
  <dl><dt></dt><dd>
    <dl><dt>Parameters:</dt></dl>
    <ul class="nomargin">
        <li><strong class="pname"><code>content</code></strong> (str) - C++ source code</li>
        <li><strong class="pname"><code>destination</code></strong> (str) - file name for GCC-XML generated file</li>
    </ul>
    <dl><dt>Returns:</dt>
        <dd>returns file name of GCC-XML generated file</dd></dl>
  </dd></dl>
</td></tr></table>
</div>
<a name="read_file"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">read_file</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">source_file</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    >&nbsp;
    </td>
  </table>
  
  <br />Reads C++ source file and returns declarations tree
  <dl><dt></dt><dd>
    <dl><dt>Parameters:</dt></dl>
    <ul class="nomargin">
        <li><strong class="pname"><code>source_file</code></strong> (str) - path to C++ source file</li>
    </ul>
  </dd></dl>
</td></tr></table>
</div>
<a name="read_xml_file"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">read_xml_file</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">gccxml_created_file</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    >&nbsp;
    </td>
  </table>
  
  <br />Reads GCC-XML generated XML file.
  <dl><dt></dt><dd>
    <dl><dt>Parameters:</dt></dl>
    <ul class="nomargin">
        <li><strong class="pname"><code>gccxml_created_file</code></strong> (str) - path to GCC-XML generated file</li>
    </ul>
    <dl><dt>Returns:</dt>
        <dd>declarations tree</dd></dl>
  </dd></dl>
</td></tr></table>
</div>
<a name="read_string"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">read_string</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">content</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    >&nbsp;
    </td>
  </table>
  
  <br />Reads Python string, that contains valid C++ code, and returns 
  declarations tree.
  <dl><dt></dt><dd>
  </dd></dl>
</td></tr></table>
</div>
<br />
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">
  <!-- Home link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="pygccxml-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Project homepage -->
      <th class="navbar" align="right" width="100%">
        <table border="0" cellpadding="0" cellspacing="0">
          <tr><th class="navbar" align="center"
            ><a class="navbar" target="_top" href="http://www.language-binding.net">pygccxml</a></th>
          </tr></table></th>
  </tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
  <tr>
    <td align="left" class="footer">Generated by Epydoc
        3.0alpha3 on Thu Oct 19 08:14:27 2006</td>
    <td align="right" class="footer">
      <a href="http://epydoc.sourceforge.net">http://epydoc.sourceforge.net</a>
    </td>
  </tr>
</table>

<script type="text/javascript">
  <!--
  // Private objects are initially displayed (because if
  // javascript is turned off then we want them to be
  // visible); but by default, we want to hide them.  So hide
  // them unless we have a cookie that says to show them.
  checkCookie()
  // -->
</script>
  
</body>
</html>
